<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>班级管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ems/emsCourse/">班级列表</a></li>
		<shiro:hasPermission name="ems:emsCourse:edit"><li><a href="${ctx}/ems/emsCourse/form">班级添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="emsCourse" action="${ctx}/ems/emsCourse/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>所属学期：</label>
				<%-- <form:input path="term.id" htmlEscape="false" maxlength="64" class="input-medium"/> --%>
				<form:select path="term.id" class="input-medium">
					<option value="">---请选择---</option>
					<c:forEach items="${terms }" var="term" varStatus="stat">
						<form:option value="${term.id }">${term.name }</form:option>
					</c:forEach>
				</form:select>
			</li>
			<li><label>所属部门：</label>
				<%-- <form:input path="term.id" htmlEscape="false" maxlength="64" class="input-medium"/> --%>
				<%-- <select name="major.dept.id" id="dept" class="input-medium" onclick="showMajor(this,'major');">
					<option value="">---请选择---</option>
					<c:forEach items="${depts }" var="dept" varStatus="stat">
						<option value="${dept.id }">${dept.name }</option>
					</c:forEach>
				</select> --%>
				
				<form:select path="major.dept.id" id="dept" class="input-medium" onclick="showMajor(this,'major');">
					<option value="">---请选择---</option>
					<c:forEach items="${depts }" var="dept" varStatus="stat">
						<form:option value="${dept.id }">${dept.name }</form:option>
					</c:forEach>
				</form:select>
			</li>
			<li><label>所属专业：</label>
				<%-- <form:input path="major.id" htmlEscape="false" maxlength="64" class="input-medium"/> --%>
				<select name="major.id" id="major" class="input-medium">
					<option value="">---请选择---</option>
					<c:forEach items="${majors }" var="major" varStatus="stat">
						<option value="${major.id }">${major.name }</option>
					</c:forEach>
				</select>
			</li>
			
			<li><label>班级代码：</label>
				<form:input path="code" htmlEscape="false" maxlength="8" class="input-medium"/>
			</li>
			<li><label>班级名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>班级代码</th>
				<th>班级名称</th>
				<th>班级logo</th>
				<th>所属学期</th>
				<th>所属部门</th>
				<th>所属专业</th>
				<th>学时</th>
				<th>学费</th>
				<th>统一折扣</th>
				<th>招生对象</th>
				<th>招生人数</th>
				<th>教室</th>
				<th>开课时间</th>
				<th>上课时间</th>
				<th>任课教师</th>
				<th>班级类型</th>
				<th>是否启用</th>
				<th>修改时间</th>
				<th>备注</th>
				<shiro:hasPermission name="ems:emsCourse:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="emsCourse">
			<tr>
				<td><a href="${ctx}/ems/emsCourse/form?id=${emsCourse.id}">
					${emsCourse.code}
				</a></td>
				<td>
					${emsCourse.name}
				</td>
				<td>
					<img alt="未上传" src="${emsCourse.logo }" style="width: 50px;height: 50px;">
				</td>
				<td>
					${emsCourse.term.name}
				</td>
				<td>
					${emsCourse.major.dept.name}
				</td>
				<td>
					${emsCourse.major.name}
				</td>
				<td>
					${emsCourse.classHours}
				</td>
				<td>
					${emsCourse.fee}
				</td>
				<td>
					${emsCourse.discount}
				</td>
				<td>
					${emsCourse.face}
				</td>
				<td>
					${emsCourse.num}
				</td>
				<td>
					${emsCourse.classroom.name}
				</td>
				<td>
					<fmt:formatDate value="${emsCourse.beginTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${emsCourse.classTime}
				</td>
				<td>
					${emsCourse.teacher.name}
				</td>
				<td>
					${emsCourse.type}
				</td>
				<td>
					${fns:getDictLabel(emsCourse.status, 'yes_no', '')}
				</td>
				<td>
					<fmt:formatDate value="${emsCourse.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${emsCourse.remarks}
				</td>
				<shiro:hasPermission name="ems:emsCourse:edit"><td>
    				<a href="${ctx}/ems/emsCourse/form?id=${emsCourse.id}">修改</a>
					<a href="${ctx}/ems/emsCourse/delete?id=${emsCourse.id}" onclick="return confirmx('确认要删除该班级吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>